﻿Imports System.Windows.Forms

Public Class frmParamStats

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        SaveControlValues(REGAPP, Me)
        SaveWindowPos(REGAPP, Me)
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub chkShowDetails_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkShowDetails.CheckedChanged
        chkSuppressSummary.Enabled = chkShowDetails.Checked
    End Sub

    Private Sub frmParamStats_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        GetWindowPos(REGAPP, Me)
        chkSuppressSummary.Enabled = chkShowDetails.Checked
        GetControlValues(REGAPP, Me)
    End Sub

    Private Sub cbo_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboPercentiles.SelectedIndexChanged, cboAverages.SelectedIndexChanged
        If cboAverages.SelectedIndex = 0 Then
            cboPercentiles.SelectedIndex = -1
        Else
            If cboPercentiles.SelectedIndex = -1 Then cboPercentiles.SelectedIndex = 0
        End If
        lblPercentiles.Enabled = cboAverages.SelectedIndex > 0
        cboPercentiles.Enabled = cboAverages.SelectedIndex > 0
        lblNumObs.Enabled = cboPercentiles.SelectedIndex > 1
        txtNumObs.Enabled = cboPercentiles.SelectedIndex > 1
    End Sub
End Class
